package org.lab.mtga.core.services;

import java.util.List;
import java.util.Random;

public class RandomService {

	private static final int ENTROPY = 100;

	public <T> void randomize(List<T> list) {
		int size = list.size();
		Random random = new Random();
		for (int i = 0; i < size * ENTROPY; i++) {
			int a = random.nextInt(size);
			int b = random.nextInt(size);
			if (a != b) {
				T item = list.get(a);
				list.set(a, list.get(b));
				list.set(b, item);
			}
		}
	}
}
